//
//  HQStyleUserSearchCell.m
//  MobileiOS
//
//  Created by 郝庆松 on 2018/5/20.
//  Copyright © 2018年 PCITC. All rights reserved.
//

#import "HQStyleUserSearchCell.h"
#import "HQSearchObject.h"

@implementation HQStyleUserSearchCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
}

-(void)setDataInfo:(id)dataInfo{
    _dataInfo = dataInfo;
    HQSearchObject *s = _dataInfo;
    if([s.isOpenHeSuan isEqualToString:@"YES"]){
        self.widthContraint.constant = 60;
    }else{
        self.widthContraint.constant = 0;
    }
    _unit.text = s.c_unit;
    [_mingCheng setTitle:[NSString stringWithFormat:@"%@",s.c_name] forState:UIControlStateNormal];
    _shuLiang.text = [NSString stringWithFormat:@"%@",s.price];
}

/**
 生成Cell
 
 @param tableView 列表
 @return ***
 */
+(instancetype)cellWithTableView:(UITableView*)tableView{
    static NSString *CellIdentifer = @"HQStyleUserSearchCell";
    HQStyleUserSearchCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifer];
    if(!cell){
        [tableView registerNib:[UINib nibWithNibName:CellIdentifer bundle:nil] forCellReuseIdentifier:CellIdentifer];
        cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifer];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
